/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.haipv.gtkhoa501.screen;

import com.haipv.gtkhoa501.controller.Controller;
import com.haipv.gtkhoa501.controller.Event;
import com.haipv.gtkhoa501.model.Var;
import com.nokia.lwuit.components.HeaderBar;
import com.sun.lwuit.Command;
import com.sun.lwuit.Display;
import com.sun.lwuit.Font;
import com.sun.lwuit.Form;
import com.sun.lwuit.TextArea;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;
import com.sun.lwuit.layouts.BoxLayout;


public class AboutScreen extends Form implements ActionListener{

    
   // private String title = "Thông tin";
    Command back= new Command(Var.back);

    public AboutScreen() {
//        Display.getInstance().setForceFullScreen(true);
        
        HeaderBar header = null;
        try {
            header = new HeaderBar(Var.about);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        header.setHeaderTitleColor(Var.colorHearder);
        header.getStyle().setBgColor(Var.colorWhite);
        
    
        header.setScrollable(false);
        
        addComponent(header);
        
//      setTitle(Var.about);  
        
        Font font = Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL);
    
        //setLayout(new BoxLayout(CENTER));
        TextArea ta = new TextArea("Application name: Luat Giao Thong  "
                + "\n\nVersion: 1.0  "
                + "\n\nDeverloper: Nova",10,10);
        setScrollable(false);
        //ta.setGrowByContent(true);
        ta.setEditable(false);
        setBackCommand(back);
        addCommand(back);
        addCommandListener(this);
        addComponent(ta);
    }

    public void actionPerformed(ActionEvent ae) {
        if (ae.getCommand()==back){
            Controller.getInstance().handleEvent(Event.MAIN_ACTION, null);
        }
    }
}
